package com.example.lottery.dao.mapper;

import com.example.lottery.controller.param.FindPrizeListParam;
import com.example.lottery.dao.dataobject.PrizeDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PrizeMapper {
    int insert(PrizeDO row);

    int insertSelective(PrizeDO row);

    PrizeDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(PrizeDO row);

    int updateByPrimaryKey(PrizeDO row);

    /**
     * 根据currentPage当前页 PageSize 每页个数 构造sql查询语句
     * @param param1 (currentPage-1)*PageSize
     * @param parma2 PageSize
     * @return 返回奖品列表
     */
    List<PrizeDO> selectPrizeListByPage(@Param("param1") Integer param1, @Param("param2") Integer parma2);

    /**
     *
     * @return 返回奖品总数
     */
    Integer selectAllPrizeSize();

    List<Long> selectByPrizeIds(@Param("prizeIds") List<Long> prizeIds);

    List<PrizeDO> selectListByIds(@Param("prizeIds")List<Long> prizeIds);

    String selectNameById(@Param("id") Long id);
}